Contains(TSource) Method (ParallelQuery(TSource), TSource, IEqualityComparer(TSource))

Task Parallel System.Threading

Determines in parallel whether a sequence contains a specified element by using a specified IEqualityComparer{T}.

Namespace:  System.Linq
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Shared Function Contains(Of TSource) ( _
	source As ParallelQuery(Of TSource), _
	value As TSource, _
	comparer As IEqualityComparer(Of TSource) _
) As Boolean
C#
public static bool Contains<TSource>(
	ParallelQuery<TSource> source,
	TSource value,
	IEqualityComparer<TSource> comparer
)

Parameters

source
Type: System.Linq..::.ParallelQuery<(Of <(TSource>)>)
A sequence in which to locate a value.
value
Type: TSource
The value to locate in the sequence.
comparer
Type: System.Collections.Generic..::.IEqualityComparer<(Of <(TSource>)>)
An equality comparer to compare values.

Type Parameters

TSource
The type of elements of source.

Return Value

true if the source sequence contains an element that has the specified value; otherwise, false.

Exceptions

ExceptionCondition
System..::.ArgumentNullException source is a null reference (Nothing in Visual Basic).
System..::.AggregateException One or more exceptions occurred during the evaluation of the query.
System..::.OperationCanceledException The query was canceled.

See Also